<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico" >
<link rel="Shortcut Icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" href="node_modules/element-ui/lib/theme-chalk/index.css">    
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="satext/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script><![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>闲鱼mini</title>
<meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<!--_header 作为公共模版分离出去-->
<header class="navbar-wrapper">
	<div class="navbar navbar-fixed-top">
		<div class="container-fluid cl"> <a class="logo navbar-logo f-l mr-10 hidden-xs" href="/aboutHui.shtml">闲鱼mini</a> <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="/aboutHui.shtml">H-ui</a> <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
			
			<nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
				<ul class="cl">
					<li>超级管理员</li>
					<li class="dropDown dropDown_hover"> <a href="#" class="dropDown_A">admin <i class="Hui-iconfont">&#xe6d5;</i></a>
						<ul class="dropDown-menu menu radius box-shadow">
							<li><a href="javascript:;" onClick="myselfinfo()">个人信息</a></li>
						</ul>
					</li>
					
					<!-- <li id="Hui-skin" class="dropDown right dropDown_hover"> <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size:18px">&#xe62a;</i></a>
						<ul class="dropDown-menu menu radius box-shadow">
							<li><a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a></li>
							<li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
							<li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
							<li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
							<li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
							<li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
						</ul>
					</li> -->
				</ul>
			</nav>
		</div>
	</div>
</header>
<!--/_header 作为公共模版分离出去-->

<!--_menu 作为公共模版分离出去-->
<aside class="Hui-aside">
	
	<div class="menu_dropdown bk_2">
		<dl id="menu-article">
			<dt><i class="Hui-iconfont">&#xe616;</i> 查看所有信息<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li><a href="resource.html" title="资源信息查看">查看所有资源信息</a></li>
				</ul>
				<ul>
					<li><a href="resource-c.html" title="资源信息查看">查看所有二手信息</a></li>
				</ul>
				<ul>
					<li><a href="resource-h.html" title="资源信息查看">查看所有求购信息</a></li>
				</ul>
				<ul>
					<li><a href="resource-u.html" title="资源信息查看">查看所有用户信息</a></li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-picture">
			<dt><i class="Hui-iconfont">&#xe613;</i> 申请审批<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li><a href="examine-r.html" title="资源申请">资源申请审批</a></li>
				</ul>
				<ul>
					<li><a href="examine-c.html" title="二手申请">二手申请审批</a></li>
				</ul>
				<ul>
					<li><a href="examine-h.html" title="求购申请">求购申请审批</a></li>
				</ul>
			</dd>
		</dl>


	</div>
</aside>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<!--/_menu 作为公共模版分离出去-->

<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 申请审批 <span class="c-gray en">&gt;</span> 资源申请列表<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="Hui-article">
		<article class="cl pd-20">
			<div class="text-c"> 
				<input type="text" class="input-text" style="width:250px" placeholder="输入审批id" id="searchResourceExamineInput">
				
				<button type="text" class="btn btn-success radius" id="btn_searchResourceExamine"><i class="Hui-iconfont">&#xe665;</i> 搜申请</button>
		
			</div>
			<div class="mt-20">
				<table class="table table-border table-bordered table-hover table-bg table-sort" id="myTable">
					<thead>
						<tr class="text-c">
							<th width="20">ID</th>
							<th width="40">用户名</th>
							<th width="50">审批状态</th>
							<th width="50">名称</th>
							<th width="100">描述</th>
							<!-- <th width="200">图片</th> -->
							<th width="20">价格</th>
							<th width="60">收费类型</th>
							<th width="20">评分</th>
							<th width="60">开始时间</th>
							<th width="60">结束时间</th>
							<th width="50">分类</th>
							<th width="50">时段</th>
							<th width="100">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr class="text-c">
							
						</tr>
					</tbody>
				</table>

				<table class="table table-border table-bordered table-hover table-bg table-sort" id="newTable" style="display: none;">
					<thead>
						<tr class="text-c">
							<th width="80">ID</th>
							<th width="100">用户名</th>
							<th width="130">类型</th>
							<th width="120">审批状态</th>
							<th width="40">ltime</th>
							<th width="50">rid</th>
							<th width="100">etime</th>
						</tr>
					</thead>
					<tbody>
						<tr class="text-c">
							
						</tr>
					</tbody>
				</table>

			</div>
			
		</article>
	</div>
</section>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script> 
 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.page.js"></script> 

<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">


/*资源审批数据获取*/
$(function(){
	
    $.ajax({
        url:'http://123.57.243.139:8080/examine/queryByType?type=1',
        type:'get',
        dataType:'json',
		async:false,
        success:function(result){
			//方法中传入的参数data为后台获取的数据
            for(var i=0;i<result.length;i++) //data.data指的是数组，数组里是8个对象，i为数组的索引
            {
				var tr;   
				tr='<td>'+result[i].eid+'</td>'
					+'<td>'+result[i].uid+'</td>';
					
				if(result[i].status == 1)
				{
					tr +=  '<td>'+'未审批'+'</td>';
				}else if(result[i].status == 2)
				{
					tr +=  '<td>'+'审批通过'+'</td>';
				}else if(result[i].status == 3)
				{
					tr +=  '<td>'+'审批不通过'+'</td>';
				}
				tr += secondsearch(result[i].rid,result[i].eid);
				console.log(tr);
               $("#myTable").append('<tr>'+tr+'</tr>');
            }
        }
    });
})

function secondsearch(rsp1,rsp2){
	var tr;
	$.ajax({
		url:'http://123.57.243.139:8080/resource/getById?rid='+rsp1,
		type:'get',
		dataType:'json',
		async:false,
		success:function(result){
			//alert(result);
			console.log(result);
			
				tr  ='<td>'+result.rname+'</td>'
					+'<td>'+result.rdescription+'</td>'
					// +'<td>'+result.rpicture+'</td>'
					+'<td>'+result.price+'</td>';
				if(result.type == 1)
				{
					tr +=  '<td>'+'付费资源'+'</td>';
				}else if(result.type == 0)
				{
					tr += '<td>'+'免费资源'+'</td>';
				}

				tr += '<td>'+result.tscore+'</td>'
				    +'<td>'+result.stime+'</td>'
					+'<td>'+result.etime+'</td>';
				if(result.classify == 1)
				{
					tr += '<td>'+'电子产品'+'</td>';
				}else if(result.classify == 2)
				{
					tr += '<td>'+'人力资源'+'</td>';
				}else if(result.classify == 3)
				{
					tr += '<td>'+'场馆'+'</td>';
				} else if(result.classify == 4)
				{
					tr += '<td>'+'交通工具'+'</td>';
				}else if(result.classify == 5)
				{
					tr += '<td>'+'书籍'+'</td>';
				} else if(result.classify == 6)
				{
					tr += '<td>'+'其他'+'</td>';
				} 

                tr += '<td>'+result.selected+'</td>'
					+'<td>'
					+'<button id="examiner-yes" type="text" onclick="examinecheck('+rsp2+','+2+')">通过审批</button>'
					+'<button id="examiner-no" type="text" onclick="examinecheck('+rsp2+','+3+')">不通过</button>'
					+'</td>';
		}
	});
	return tr;
}

/*资源审批*/
function examinecheck(rsp1,rsp2){
	$.ajax({
		url:'http://123.57.243.139:8080/examine/updateResource?eid='+rsp1+'&status='+rsp2,
		type:'post',
		dataType:'json',
		async:false,
		success:function(result){
			alert("审批完成！");
		}
		
	});
}

/*搜索*/
$(function(){
	$("#btn_searchResourceExamine").click(function(){

		var input;
	
		input = document.getElementById("searchResourceExamineInput").value;
		//alert(input);
		$("#myTable").hide();
		$("#newTable").show();
		$.ajax({
			url:'http://123.57.243.139:8080/examine/getByEid?eid='+input,
			type:'get',
			dataType:'json',
			success:function(result){
			//alert("搜索成功");
			var tr;
					tr ='<td>'+result.eid+'</td>'
						+'<td>'+result.uid+'</td>';
					if(result.type == 1)
					{
						tr +=  '<td>'+'付费资源'+'</td>';
					}else if(result.type == 0)
					{
						tr += '<td>'+'免费资源'+'</td>';
					}

					if(result.status == 1)
					{
						tr +=  '<td>'+'未审批'+'</td>';
					}else if(result.status == 2)
					{
						tr +=  '<td>'+'审批通过'+'</td>';
					}else if(result.status == 3)
					{
						tr +=  '<td>'+'审批不通过'+'</td>';
					}
					tr += '<td>'+result.ltime+'</td>'
						+'<td>'+result.rid+'</td>'
						+'<td>'+result.etime+'</td>';
					console.log(tr);
               	$("#newTable").append('<tr>'+tr+'</tr>');
			}
		
		});
	})
})




</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>